<?php
class Category {
	private function _getAll() {
		$oCache = Base::loadClass ( 'Cache' );
		var_dump ( $oCache->get ( 'all', __CLASS__ ) );
	}
	
	public function getNode() {
		self::_getAll ();
	}
	
	public function getItem($iCategoryId) {
		$oCache = Base::loadClass ( 'Cache' );
		$aData = $oCache->get ( $iCategoryId, __CLASS__ );
		
		if ($aData == '__NOCACHE__') {
			$oDb = Base::loadClass ( 'Db' );
			$sSql = 'SELECT 
					ite_id id, 
					ite_name name, 
					ite_link_id linkId, 
					ite_image_path image, 
					ite_content content, 
					ite_time createTime, 
					ite_use_id userId, 
					ite_user_privilege userPriv, 
					ite_group_privilege groupPriv
				FROM 
					item 
				WHERE
					ite_cat_id = ?
					AND ite_status = "active"';
			$oDb->query ( $sSql, $iCategoryId );
			$aData = $oDb->getRows ();
			$oCache->set ( $iCategoryId, $aData, __CLASS__ );
		}
		
		return $aData;
	}
}
?>